home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / programs_-_include / ASM-SPAR.{_A / TERMBITS.H < prev    next >
C/C++ Source or Header  |  1999-09-17  |  6KB  |  229 lines

  1. #ifndef _SPARC64_TERMBITS_H
  2. #define _SPARC64_TERMBITS_H
  3.  
  4. #include <linux/posix_types.h>
  5.  
  6. typedef unsigned char   cc_t;
  7. typedef unsigned int    speed_t;
  8.  
  9. /* XXX is this right for sparc64?  it was an unsigned long... XXX */
  10. typedef unsigned int    tcflag_t;
  11.  
  12. #define NCC 8
  13. struct termio {
  14.     unsigned short c_iflag;        /* input mode flags */
  15.     unsigned short c_oflag;        /* output mode flags */
  16.     unsigned short c_cflag;        /* control mode flags */
  17.     unsigned short c_lflag;        /* local mode flags */
  18.     unsigned char c_line;        /* line discipline */
  19.     unsigned char c_cc[NCC];    /* control characters */
  20. };
  21.  
  22. #define NCCS 17
  23. struct termios {
  24.     tcflag_t c_iflag;        /* input mode flags */
  25.     tcflag_t c_oflag;        /* output mode flags */
  26.     tcflag_t c_cflag;        /* control mode flags */
  27.     tcflag_t c_lflag;        /* local mode flags */
  28.     cc_t c_line;            /* line discipline */
  29.     cc_t c_cc[NCCS];        /* control characters */
  30. #ifdef __KERNEL__
  31. #define SIZEOF_USER_TERMIOS sizeof (struct termios) - (2*sizeof (cc_t))
  32.     cc_t _x_cc[2];                  /* We need them to hold vmin/vtime */
  33. #endif
  34. };
  35.  
  36. /* c_cc characters */
  37. #define VINTR    0
  38. #define VQUIT    1
  39. #define VERASE   2
  40. #define VKILL    3
  41. #define VEOF     4
  42. #define VEOL     5
  43. #define VEOL2    6
  44. #define VSWTC    7
  45. #define VSTART   8
  46. #define VSTOP    9
  47.  
  48.  
  49.  
  50. #define VSUSP    10
  51. #define VDSUSP   11  /* SunOS POSIX nicety I do believe... */
  52. #define VREPRINT 12
  53. #define VDISCARD 13
  54. #define VWERASE  14
  55. #define VLNEXT   15
  56.  
  57. /* Kernel keeps vmin/vtime separated, user apps assume vmin/vtime is
  58.  * shared with eof/eol
  59.  */
  60. #ifdef __KERNEL__
  61. #define VMIN     16
  62. #define VTIME    17
  63. #else
  64. #define VMIN     VEOF
  65. #define VTIME    VEOL
  66. #endif
  67.  
  68. /* c_iflag bits */
  69. #define IGNBRK    0x00000001
  70. #define BRKINT    0x00000002
  71. #define IGNPAR    0x00000004
  72. #define PARMRK    0x00000008
  73. #define INPCK    0x00000010
  74. #define ISTRIP    0x00000020
  75. #define INLCR    0x00000040
  76. #define IGNCR    0x00000080
  77. #define ICRNL    0x00000100
  78. #define IUCLC    0x00000200
  79. #define IXON    0x00000400
  80. #define IXANY    0x00000800
  81. #define IXOFF    0x00001000
  82. #define IMAXBEL    0x00002000
  83.  
  84. /* c_oflag bits */
  85. #define OPOST    0x00000001
  86. #define OLCUC    0x00000002
  87. #define ONLCR    0x00000004
  88. #define OCRNL    0x00000008
  89. #define ONOCR    0x00000010
  90. #define ONLRET    0x00000020
  91. #define OFILL    0x00000040
  92. #define OFDEL    0x00000080
  93. #define NLDLY    0x00000100
  94. #define   NL0    0x00000000
  95. #define   NL1    0x00000100
  96. #define CRDLY    0x00000600
  97. #define   CR0    0x00000000
  98. #define   CR1    0x00000200
  99. #define   CR2    0x00000400
  100. #define   CR3    0x00000600
  101. #define TABDLY    0x00001800
  102. #define   TAB0    0x00000000
  103. #define   TAB1    0x00000800
  104. #define   TAB2    0x00001000
  105. #define   TAB3    0x00001800
  106. #define   XTABS    0x00001800
  107. #define BSDLY    0x00002000
  108. #define   BS0    0x00000000
  109. #define   BS1    0x00002000
  110. #define VTDLY    0x00004000
  111. #define   VT0    0x00000000
  112. #define   VT1    0x00004000
  113. #define FFDLY    0x00008000
  114. #define   FF0    0x00000000
  115. #define   FF1    0x00008000
  116. #define PAGEOUT 0x00010000  /* SUNOS specific */
  117. #define WRAP    0x00020000  /* SUNOS specific */
  118.  
  119. /* c_cflag bit meaning */
  120. #define CBAUD      0x0000100f
  121. #define  B0      0x00000000   /* hang up */
  122. #define  B50      0x00000001
  123. #define  B75      0x00000002
  124. #define  B110      0x00000003
  125. #define  B134      0x00000004
  126. #define  B150      0x00000005
  127. #define  B200      0x00000006
  128. #define  B300      0x00000007
  129. #define  B600      0x00000008
  130. #define  B1200      0x00000009
  131. #define  B1800      0x0000000a
  132. #define  B2400      0x0000000b
  133. #define  B4800      0x0000000c
  134. #define  B9600      0x0000000d
  135. #define  B19200      0x0000000e
  136. #define  B38400      0x0000000f
  137. #define EXTA      B19200
  138. #define EXTB      B38400
  139. #define  CSIZE    0x00000030
  140. #define   CS5      0x00000000
  141. #define   CS6      0x00000010
  142. #define   CS7      0x00000020
  143. #define   CS8      0x00000030
  144. #define CSTOPB      0x00000040
  145. #define CREAD      0x00000080
  146. #define PARENB      0x00000100
  147. #define PARODD      0x00000200
  148. #define HUPCL      0x00000400
  149. #define CLOCAL      0x00000800
  150. #define CBAUDEX   0x00001000
  151. #define  B57600   0x00001001
  152. #define  B115200  0x00001002
  153. #define  B230400  0x00001003
  154. #define  B460800  0x00001004
  155. /* This is what we can do with the Zilogs. */
  156. #define  B76800   0x00001005
  157. /* This is what we can do with the SAB82532. */
  158. #define  B153600  0x00001006
  159. #define  B307200  0x00001007
  160. #define  B614400  0x00001008
  161. #define  B921600  0x00001009
  162. /* And these are the rest... */
  163. #define  B500000  0x0000100a
  164. #define  B576000  0x0000100b
  165. #define B1000000  0x0000100c
  166. #define B1152000  0x0000100d
  167. #define B1500000  0x0000100e
  168. #define B2000000  0x0000100f
  169. #define B2500000  0x00001010
  170. #define B3000000  0x00001011
  171. #define B3500000  0x00001012
  172. #define B4000000  0x00001013
  173. #define CIBAUD      0x100f0000  /* input baud rate (not used) */
  174. #define CMSPAR    0x40000000  /* mark or space (stick) parity */
  175. #define CRTSCTS      0x80000000  /* flow control */
  176.  
  177. /* c_lflag bits */
  178. #define ISIG    0x00000001
  179. #define ICANON    0x00000002
  180. #define XCASE    0x00000004
  181. #define ECHO    0x00000008
  182. #define ECHOE    0x00000010
  183. #define ECHOK    0x00000020
  184. #define ECHONL    0x00000040
  185. #define NOFLSH    0x00000080
  186. #define TOSTOP    0x00000100
  187. #define ECHOCTL    0x00000200
  188. #define ECHOPRT    0x00000400
  189. #define ECHOKE    0x00000800
  190. #define DEFECHO 0x00001000  /* SUNOS thing, what is it? */
  191. #define FLUSHO    0x00002000
  192. #define PENDIN    0x00004000
  193. #define IEXTEN    0x00008000
  194.  
  195. /* modem lines */
  196. #define TIOCM_LE    0x001
  197. #define TIOCM_DTR    0x002
  198. #define TIOCM_RTS    0x004
  199. #define TIOCM_ST    0x008
  200. #define TIOCM_SR    0x010
  201. #define TIOCM_CTS    0x020
  202. #define TIOCM_CAR    0x040
  203. #define TIOCM_RNG    0x080
  204. #define TIOCM_DSR    0x100
  205. #define TIOCM_CD    TIOCM_CAR
  206. #define TIOCM_RI    TIOCM_RNG
  207.  
  208. /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
  209. #define TIOCSER_TEMT    0x01    /* Transmitter physically empty */
  210.  
  211.  
  212. /* tcflow() and TCXONC use these */
  213. #define    TCOOFF        0
  214. #define    TCOON        1
  215. #define    TCIOFF        2
  216. #define    TCION        3
  217.  
  218. /* tcflush() and TCFLSH use these */
  219. #define    TCIFLUSH    0
  220. #define    TCOFLUSH    1
  221. #define    TCIOFLUSH    2
  222.  
  223. /* tcsetattr uses these */
  224. #define    TCSANOW        0
  225. #define    TCSADRAIN    1
  226. #define    TCSAFLUSH    2
  227.  
  228. #endif /* !(_SPARC64_TERMBITS_H) */
  229.